import { ProColumns } from '@ant-design/pro-components'

const columns: ProColumns[] = [
  {
    title: '设备编号',
    dataIndex: 'deviceId',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项'
        }
      ]
    },
    width: '30%'
  },
  {
    title: '设备名称',
    dataIndex: 'deviceName',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项'
        }
      ]
    },
    width: '30%'
  },
  {
    title: '设备类型',
    dataIndex: 'deviceType',
    valueType: 'select',
    valueEnum: {
      1: '火灾探测设备',
      2: '灭火设备',
      3: '疏散指示设备'
    },
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项'
        }
      ]
    },
    width: '30%'
  },
  {
    title: '型号',
    dataIndex: 'model',
    search: false,
    width: '30%'
  },
  {
    title: '安装位置',
    dataIndex: 'installationLocation',
    search: false,
    width: '30%'
  },
  {
    title: '安装时间',
    dataIndex: 'installationDate',
    search: false,
    width: '30%'
  },
  {
    title: '工作状态',
    dataIndex: 'operatingStatus',
    valueType: 'select',
    valueEnum: {
      1: '运行中',
      2: '维修中',
      3: '已废弃'
    },
    width: '30%'
  },
  {
    title: '电池电量',
    dataIndex: 'batteryLevel',
    search: false,
    width: '30%'
  },
  {
    title: '灭火剂量',
    dataIndex: 'fireExtinguishingAgentQuantity',
    search: false,
    width: '30%'
  },
  {
    title: '创建时间',
    key: 'showTime',
    dataIndex: 'created_at',
    valueType: 'date',
    hideInSearch: true,
    width: '30%',
    formItemProps: {
      rules: [
        {
          required: true,
          message: '此项为必填项'
        }
      ]
    }
  }
]
export default columns
